-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [IOBP-502] Disable swipe back while payment outcome showed #5434
Conversation
…ck-while-outcome-showed
…ck-while-outcome-showed
…ck-while-outcome-showed
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5434 +/- ##
==========================================
- Coverage 47.42% 47.42% -0.01%
==========================================
Files 1603 1603
Lines 33641 33643 +2
Branches 8219 8219
==========================================
Hits 15955 15955
- Misses 17628 17630 +2
Partials 58 58
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this implementation untidy, but I've found no better way to make it work to spec, so LGTM as long as we also track a task to remove this once we upgrade react-navigation 👍
// This is a workaround to disable swipe back gesture on this screen | ||
// .. it should be removed as soon as the migration to react-navigation v6 is completed | ||
React.useEffect(() => { | ||
// Disable swipe | ||
navigation.setOptions({ gestureEnabled: false }); | ||
navigation.getParent()?.setOptions({ gestureEnabled: false }); | ||
// Re-enable swipe after going back | ||
return () => { | ||
navigation.getParent()?.setOptions({ gestureEnabled: true }); | ||
}; | ||
}, [navigation]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a reference to the ticket to work on later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely! Added into 86f5258
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Short description
This PR disables the swipe-back on iOS devices and the Android hardware back button when the payment outcome screen is shown.
List of changes proposed in this pull request
useAvoidHardwareBackButton
in order to disable the Android back button;How to test
If you complete a new payment flow until you reach the outcome screen, you shouldn't be able to return to the previous screen.